part of _;

extension on ShowVideoPage {
  Widget view_video() {
    return GestureDetector(
      child: Container(
        width: yScreenSize().width,
        height: yScreenSize().height,
        color: Colors.black,
        child: Stack(
          alignment: Alignment.center,
          children: [
            YToggleWidget(
              isShowChildA: isPlaying,
              childA: () => Container(
                width: yScreenSize().width,
                color: Colors.black,
                child: Chewie(controller: chewieController!),
              ),
              childB: () => YEmpty(),
            ),
            YToggleWidget(
              isShowChildA: isPlaying,
              childA: () => YEmpty(),
              childB: () => video.startsWith("http")
                  ? ImageFiltered(
                      imageFilter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
                      child: YImage(yScreenSize().width, yScreenSize().height, YOSS.ossVideo2Image(video), fit: BoxFit.cover),
                    )
                  : YEmpty(),
            ),
            YToggleWidget(
              isShowChildA: isPlaying,
              childA: () => YEmpty(),
              childB: () => YCircularProgress(),
            ),
          ],
        ),
      ),
      // onTap: () => yFinish(),
      onLongPress: () => controller_showActions(),
    );
  }

  Widget view_close() {
    return Positioned(
      top: yStatubarHeight() + 10,
      left: 10,
      child: YInkRoundButton(Icon(Icons.close, color: Colors.white), onTap: () => yFinish()),
    );
  }

  Widget view_netState() {
    return Positioned(
      bottom: ySafeAreaBottomHeight() + 30,
      left: 30,
      child: InkWell(
        child: Icon(isNet ? Icons.wifi_rounded : Icons.folder_rounded, color: Colors.white),
        onTap: () => yToast("正在使用${isNet ? "网络" : "本地"}播放"),
      ),
    );
  }
}
